 {
        
     cc.Class({
            extends: cc.Component,
            properties: {},
            onLoad: function () {
                Global.notificationCenter.on(Global.eventName.MSG_COIN_BUY_INFO, this.showCoinBuyInfo.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.MSG_COIN_BUY, this.showCoinRecharge.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.MSG_STORE, this.showStore.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.MSG_HAPPYBAG5, this.operateHappyBags.bind(this), this);
            },
            start: function () {
            },
            operateHappyBags: function (e) {
                console.log("operateHappyBags result:", e);
                var t = Global.configCdn.getActivityAndTaskConf();
                if (t) {
                    t.taskkinds;
                    if (e && "list" == e.action) for (var n = 0; n < e.tasks.length; n++) {
                        var o = e.tasks[n];
                        100057 == o[1] && (o[2] > 0 ? Global.SetIsFirstRecharge(!0) : Global.SetIsFirstRecharge(!1),
                            Global.notificationCenter.emit(Global.eventName.MSH_SHOWFIRSTRECHARGE));
                    }
                }
            },
            showStore: function (e) {
                if (console.log("showStore data:", e), e) if (e.error) console.log("showStore error:", e.error.info); else if (e.result && 1 == e.result.ok) {
                    var t = {
                        text: "恭喜您，金币兑换成功！",
                        confirmText: "确定",
                        confirmSp: Global.spriteAtlas.getOKSpf(),
                        confirmCallback: function () {
                            console.log(" confirmCallback ");
                        }
                    };
                    Global.UIPopupManager.alert(t);
                }
            },
            showCoinBuyInfo: function (e) {
                if (e) {
                    Global.utils.hideWaitting(), console.error("没钱了，发的消息是 coin_buy_info");
                    var t = function () {
                        var e = function () {
                            Global.UIPopupManager.addPopup("PopupPanel/Panel_InviteFri", function (e) {
                            });
                        }, t = Global.roomInfoModel.getRecommendRoomId(1, !1);
                        if (cc.log("金币不足，快去分享获取金币吧=showCoinBuyInfo", t), t < 0) {
                            console.error("showCoinBuyInfo 没有房间可以选");
                            var n = Global.spriteAtlas.getOKSpfYellow();
                            e = function () {
                                SceneHelper.loadScene("homeScene");
                            };
                            var o = !0;
                            if (Global.tableModel.isInGameScene()) if (Global.tableModel.getBoolShowRewardRotateLuckLayer()) {
                                Global.utils.showRedPacketWinLucky(!0), o = !1;
                            } else if (Global.tableModel.getIsGameEnd()) o = !0; else {
                                var i = Global.tableModel.getPlayerModel(Global.config.SEAT_DOWN);
                                i && Global.tableModel.requestCharge(-1, i.getSeatId()), Global.utils.showNodeCommon(" 本局转运红包已经领完，下一把就转运了哦！", 3),
                                    o = !1;
                            } else console.log("不在游戏中"), Global.utils.showRedPacketWinLucky(), o = !1;
                            var a = {
                                text: "金币不足，回大厅获取金币吧！",
                                cancelSp: n,
                                cancelText: "确定",
                                cancelCallback: e,
                                closeCallback: function () {
                                },
                                needConfirmBtn: !1
                            };
                            o && Global.UIPopupManager.alert(a);
                        } else {
                            console.error("showCoinBuyInfo 有房间可以选");
                            var r = {
                                text: "金币不足，去打新手场或者分享获取金币吧。",
                                confirmSp: Global.spriteAtlas.getQuickStartSpf(),
                                cancelSp: Global.spriteAtlas.getGoInviteSpf(),
                                confirmText: "去新手场",
                                cancelText: "去邀请",
                                confirmCallback: function () {
                                    Global.roomInfoModel.setRoomId(t);
                                    var e = Global.roomInfoModel.getPlayModel();
                                    Global.msgHandler.requestQuickStart(e, t);
                                },
                                cancelCallback: e,
                                closeCallback: function () {
                                    console.log("closeCallback");
                                }
                            };
                            Global.UIPopupManager.alert(r);
                        }
                    }.bind(this), n = function () {
                        switch (e.buyType) {
                            case Global.config.buyType.buycoin:
                                Global.UIPopupManager.addPopup("PopupPanel/Panel_recharge", function (t) {
                                    t.getComponent("RechargePanel").bindData(e, 0);
                                });
                                break;

                            case Global.config.buyType.zhuanyun:
                                Global.UIPopupManager.addPopup("PopupPanel/Panel_recharge", function (t) {
                                    t.getComponent("RechargePanel").bindData(e, 1);
                                });
                                break;

                            case Global.config.buyType.revenge:
                                Global.UIPopupManager.addPopup("PopupPanel/Panel_recharge", function (t) {
                                    t.getComponent("RechargePanel").bindData(e, 2);
                                });
                        }
                    }.bind(this);
                    cc.sys.platform == cc.sys.WECHAT_GAME && tywx.UserInfo.isiPhone ? t() : n();
                }
            },
            showCoinRecharge: function (e) {
                if (e) if (e.error) -1 == e.error.code && Global.utils.showNodeCommon(e.error.info, 3); else if (e.result && e.result.reward && e.result.reward.length > 0) {
                    var t = {
                        text: "充值成功",
                        confirmText: "确定",
                        confirmSp: Global.spriteAtlas.getOKSpf(),
                        confirmCallback: function () {
                            Global.userProfile.setHadYuanBaoNum(e.result.yuanbao);
                        }
                    };
                    Global.UIPopupManager.alert(t);
                }
            },
            onDestroy: function () {
                Global.notificationCenter.offAll(this);
            }
        })
    }